<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>02.vue中使用animate库</title>
    <link rel="stylesheet" href="animate.css">
</head>
<style>
    @keyframes bounce-in {
        0% {
            transform: scale(0);
        }
        50% {
            transform: scale(1.5);
        }
        100% {
            transform: scale(1);
        }
    }
    .active {
        transform-origin: left center;
        animation: bounce-in 1s;
    }
    .leave {
        transform-origin: left center;
        animation: bounce-in 1s reverse;
    }
</style>
<body>
    <div id="app">
        <transition name="fade" enter-active-class="animated swing" leave-active-class="animated shake">
            <div v-show="show">hello world</div>
        </transition>
        
        <button @click="handleClick">切换</button>
    </div>
</body>
<script src="vue.js"></script>
<script>
    var app = new Vue({
        el: '#app',
        data: {
            show: true
        },
        methods: {
            handleClick: function() {
                this.show = !this.show;
            }
        }
    })
</script>
</html>